From: Richard M. Stallman Date: Wed, 14 Nov 2001 04:23:45 +0000 (+0000) Subject: (recompile): Use compilation-arguments if set, so as to be able to M-x X-Git-Tag: archive/raspbian/1%29.2+1-2+rpi1^2~5^2~60674 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:///%22http:/www.example.com/cgi/%22https:/www.github.com/%22bookmarks:/?a=commitdiff_plain;h=6867356ababf3f4345348255e3a414ce57ee7659;p=emacs.git (recompile): Use compilation-arguments if set, so as to be able to M-x recompile the exact command which created a compilation-mode buffer. --- diff --git a/lisp/progmodes/compile.el b/lisp/progmodes/compile.el index 2ab31cb764e..7e046c3ee03 100644 --- a/lisp/progmodes/compile.el +++ b/lisp/progmodes/compile.el @@ -580,10 +580,13 @@ to a function that generates a unique name." ;; run compile with the default command line (defun recompile () - "Re-compile the program including the current buffer." + "Re-compile the program including the current buffer. +If this is run in a compilation-mode buffer, re-use the arguments from the +original use. Otherwise, it recompiles using `compile-command'." (interactive) (save-some-buffers (not compilation-ask-about-save) nil) - (compile-internal (eval compile-command) "No more errors")) + (apply 'compile-internal (or compilation-arguments + `(,(eval compile-command) "No more errors")))) (defun grep-process-setup () "Set up `compilation-exit-message-function' for `grep'."